//
//  SecondViewController.m
//  ProjectTest
//
//  Created by User on 2017/10/12.
//  Copyright © 2017年 User. All rights reserved.
//

#import "SecondViewController.h"
#import "FirstViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.SecondTextField.text = self.sendString;
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)popAction:(id)sender {
    
//    [self performSegueWithIdentifier:@"backSegue" sender:sender];
    self.comeBackString = self.SecondTextField.text;
    [self performSegueWithIdentifier:@"dataComeBackSegue" sender:sender];
}

- (IBAction)ViewController1UnwindSegue:(UIStoryboardSegue *)unwindSegue {
    if ([unwindSegue.identifier isEqualToString:@"backSegue"])
    {
        
    }
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"pushToSecond"])
    {
        SecondViewController *secondVC = segue.destinationViewController;
        FirstViewController *firstVC = segue.sourceViewController;
        NSLog(@"%@",secondVC.SecondTextField.text);
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
